/*
 * Dinner.java
 * Copyright (c) 2014, 2019, Kiri. 
 * All rights reserved.
 */
package com.onesalt.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OrderColumn;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * 饭局
 *
 * @author kiri
 * @date 2015年3月5日
 * @version 1.0
 */
@Entity(name = "t_dinner")
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class Dinner implements Serializable {
	
	private static final long serialVersionUID = 899528000701509268L;

	public static final String STATUS_CANCELLED = "cancelled";
	public static final String TYPE_PRIVATE = "private";
	public static final String TYPE_PUBLIC = "public";
	
	@Id
	@GeneratedValue
	private Long dinnerId;
	
	private Long kitchenId;
	
	private String type;
	
	// 退订规则
	@ManyToOne
	private DinnerCancelRule cancelRule;

	private Date startTime;
	
	private Date endTime;
	
	private int peopleNumber;

	private int minPeopleNumber;
	
	private int maxPeopleNumber;
	
	private String status;

	private int price;
	
	private int amount;
	
	private Date deadline;
	
	private String url;
	
	private Date createTime;
	
	private Date modifyTime;
	
	@ManyToMany
	@OrderColumn(name = "sort")
	private List<Dishes> dishes;
	
	@Transient
	private Kitchen kitchen;

	public Long getDinnerId() {
		return dinnerId;
	}

	public void setDinnerId(Long dinnerId) {
		this.dinnerId = dinnerId;
	}

	public Kitchen getKitchen() {
		return kitchen;
	}

	public void setKitchen(Kitchen kitchen) {
		this.kitchen = kitchen;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public DinnerCancelRule getCancelRule() {
		return cancelRule;
	}

	public void setCancelRule(DinnerCancelRule cancelRule) {
		this.cancelRule = cancelRule;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public Integer getPeopleNumber() {
		return peopleNumber;
	}

	public void setPeopleNumber(Integer peopleNumber) {
		this.peopleNumber = peopleNumber;
	}

	public Integer getMinPeopleNumber() {
		return minPeopleNumber;
	}

	public void setMinPeopleNumber(Integer minPeopleNumber) {
		this.minPeopleNumber = minPeopleNumber;
	}

	public Integer getMaxPeopleNumber() {
		return maxPeopleNumber;
	}

	public void setMaxPeopleNumber(Integer maxPeopleNumber) {
		this.maxPeopleNumber = maxPeopleNumber;
	}

	public Date getDeadline() {
		return deadline;
	}

	public void setDeadline(Date deadline) {
		this.deadline = deadline;
	}

	public List<Dishes> getDishes() {
		return dishes;
	}

	public void setDishes(List<Dishes> dishes) {
		this.dishes = dishes;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Long getKitchenId() {
		return kitchenId;
	}

	public void setKitchenId(Long kitchenId) {
		this.kitchenId = kitchenId;
	}

	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public Integer getPrice() {
		return price;
	}

	public void setPrice(Integer price) {
		this.price = price;
	}

	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}
}
